home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / utils / file / managers / mc-3.2 / mc-3 / mc-3.2.1 / vfs / extfs / README < prev    next >
Encoding:
Text File  |  1996-05-17  |  3.4 KB  |  91 lines

  1.             Writing scripts for Midnight Commander's external vfs
  2.  
  3. IMPORTANT NOTE: extfs is not officialy released and fully bug free
  4. in 3.0! You have been warned. If you would really like to try it,
  5. you can (by typing make install.extfs in the vfs directory).
  6.  
  7. Starting with version 3.1, the Midnight Commander comes with so called
  8. extfs, which is one of the virtual filesystems. This system makes it
  9. possible to create new virtual filesystems for the GNU MC very easily.
  10.  
  11. Such work has two basic steps:
  12.  
  13. Editing $(libdir)/extfs/extfs.ini.
  14. Creating a shell script/program to handle requests.
  15. (Note: $(libdir) should be substituted for actual libdir path stored when
  16. configured or compiled, like /usr/local/lib/mc or /usr/lib/mc).
  17.  
  18. The first one is very easy:
  19. You assign a vfs prefix and vfs extensions to your vfs. Both will be used in
  20. vfs pseudoURL names, like if you assign prefix zip and extensions .zip,
  21. .ZIP, then URLs will look like
  22. zip:anypath/my.zip/some_path/in_the/archive
  23. Then you add a line to the end of the [extfs] section:
  24. prefix=space_separated_extensions
  25. e.g.
  26. zip=.zip .ZIP
  27.  
  28. The second one my require some your knowledges of shell/c programming:
  29. You have to create a program (with executable permissions) prefix in
  30. $(libdir)/extfs (in our example $(libdir)/extfs/zip).
  31.  
  32. * Commands that should be implemented by your shell script
  33. ----------------------------------------------------------
  34.  
  35. $libdir/extfs/prefix command [arguments]
  36.  
  37. * Command: list archivename
  38.  
  39. This command should list the complete archive content in the following format
  40. (a little modified ls -l listing):
  41.  
  42. AAAAAAA NNN OOOOOOOO GGGGGGGG SSSSSSSS DATETIME [PATH/]FILENAME [-> [PATH/]FILENAME[/]]]
  43.  
  44. where (things in [] are optional):
  45.  
  46. AAAAAAA  is the permission string like in ls -l
  47. NNN      is the number of links
  48. OOOOOOOO is the owner (either UID or name)
  49. GGGGGGGG is the group (either GID or name)
  50. SSSSSSSS is the file size
  51. FILENAME is the filename
  52. PATH     is the path from the archive's root without the leading slash (/)
  53. DATETIME has one of the following formats:
  54.         Mon DD hh:mm
  55.         Mon DD YYYY
  56.         Mon DD YYYY hh:mm
  57.         MM-DD-YY hh:mm
  58.  
  59.             where Mon is a three digit english month name, DD day
  60.             1-31, MM month 01-12, YY two digit year, YYYY four digit
  61.             year, hh hour and mm minute.
  62.  
  63. If the -> [PATH/]FILENAME part is present, it means:
  64.  
  65. If permissions start with an l (ell), then it is the name that symlink
  66. points to. (If this PATH starts with a MC vfs prefix, then it is a symlink
  67. somewhere to the other virtual filesystem (if you want to specify path from
  68. the local root, use local:/path_name instead of /path_name, since /path_name
  69. means from root of the archive listed).
  70. If permissions do not start with l, but number of links is greater than one,
  71. then it says that this file should be a hardlinked with the other file.
  72.  
  73.  
  74. * Command: copyout archivename storedfilename extractto
  75.  
  76. This should extract from archive archivename the file called
  77. storedfilename (possibly with path if not located in archive's root)
  78. to file extractto.
  79.  
  80. * Command: copyin archivename storedfilename sourcefile
  81.  
  82. This should add to the archivename the sourcefile with the name
  83. storedfilename inside the archive.  
  84.  
  85. Important note: archivename in the above examples may not have the
  86. extension you are expecting to have, like it may happen that
  87. archivename will be something like /tmp/f43513254 or just
  88. anything. Some archivers do not like it, so you'll have to find some
  89. workaround.
  90.  
  91.